<?php

namespace App\Entities;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class CodeRule extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'id',
        'activity_id',
        'code_status',
        'code_limits',
        'code',
        'prize_id',
        'inventory'
    ];
    public function codeRuleCreate()
    {

    }

    public function translateColumns()
    {
        return [
            'id' => $this->getAttributeValue('id'),
            'code_status' => $this->getAttributeValue('code_status'),
            'code_limits' => \GuzzleHttp\json_decode($this->getAttributeValue('code_limits')),
            'code' => $this->getAttributeValue('code'),
            'prize_id' => $this->getAttributeValue('prize_id'),
            'inventory' => $this->getAttributeValue('inventory'),
        ];
    }
}